﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AspNetCs.Common;
using AspNetCs.Enumerations.Channel_Enum;
using AspNetCs.Enumerations.Up_Enum;
using System.IO;

public partial class App_SelectVideoList : BasePage
{
    protected string formobj = "", inputobj = "", DirectPath = "";
    protected string Links = "请选择视频<br />";

    protected void Page_Load(object sender, EventArgs e)
    {
        //CheckUserExit("Login.Aspx?ReUrl=" + configInfo.InstallDir + "Users/SelectMusicList.aspx", "请您登录", true);
        if (!Page.IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request["formobj"]))
            {
                formobj = Request["formobj"].ToString().Trim();
            }
            if (!string.IsNullOrEmpty(Request["inputobj"]))
            {
                inputobj = Request["inputobj"].ToString().Trim();
            }
            ViewState["formobj"] = formobj;
            ViewState["inputobj"] = inputobj;
            DirectPath = Server.MapPath(configInfo.InstallDir + StringHelper.ReadConfig("ViedoPath"));
            GetLinks(DirectPath);
        }
    }

    public void GetLinks(string DirectPath)
    {
        FileInfo[] files = FileObj.GetFilesOfDirectory(DirectPath);
        if (files != null)
        {
            foreach (FileInfo file in files)
            {
                Links += "<br /><a onclick=\"getFilePath('" + StringHelper.ReadConfig("ViedoPath") + file.Name + "','" + inputobj + "');\" href=\"#\">" + file.Name + "</a>";
            }

        }
        else
        {
            Links += "您还没有上传视频";
        }
    }
}
